<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <!-- .number 输入的字符串类型的值 转为number类型 -->
    <input type="text" v-model.number="num">
    <div>{{num}}</div>
    <!-- .lazy 由实时触发 变为change触发  回车或失去焦点  -->
    <input type="text" v-model.lazy="msg">
    <div>{{msg}}</div>
    <!-- .trim 去除字符串首尾空格 -->
    <input type="text" v-model.trim="mystr">
    <div>{{mystr}}</div>

  </div>
  <script src="vue.js"></script>
  <script>
    var vm = new Vue({
      name: "oldbaby",// 非关键字 var function int class 等 不能为标签名div p input a
      el: "#app",
      data() {
        return {
          msg: '',
          num: '88',
          mystr: "    sadfasdf sadf  s dfasdaf   "
        }
      },
      updated() {
        console.log(typeof this.num)
      },
    })


  </script>
</body>

</html>